package beans;
import java.lang.String;

public class Video {
	long id;
	String url;
	String titulo;
	
	public Video(long id, String url, String titulo) {
		this.id = id;
		this.url = url;
		this.titulo = titulo;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getTitulo() {
		return titulo;
	}
	public void setTitulo(String titulo) {
		this.titulo = titulo;
	}
	public String getHTML(){
		
		int i = url.indexOf("v=");
		String id = url.substring(i+2);
		
		return "<object width=\"425\" height=\"344\">" +
				"<param name=\"movie\" value=\"http://www.youtube.com/v/" + id + "&hl=pt-br&fs=1\">" +
				"</param>" +
				"<param name=\"allowFullScreen\" value=\"true\"></param>" +
				"<param name=\"allowscriptaccess\" value=\"always\"></param>" +
				"<embed src=\"http://www.youtube.com/v/" + id + "				&hl=pt-br&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\">" +
				" 	</embed></object>	";
		
	}
	/* Retorna html do video  */
	public String getHTMLpeq(){
		
		int i = url.indexOf("v=");
		String id = url.substring(i+2);
		
		return "<object width=\"200\" height=\"160\">" +
				"<param name=\"movie\" value=\"http://www.youtube.com/v/" + id + "&hl=pt-br&fs=1\">" +
				"</param>" +
				"<param name=\"allowFullScreen\" value=\"true\"></param>" +
				"<param name=\"allowscriptaccess\" value=\"always\"></param>" +
				"<embed src=\"http://www.youtube.com/v/" + id + "				&hl=pt-br&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"200\" height=\"160\">" +
				" 	</embed></object>	";
		  
	}
}
